package com.security.demo.controller;

import com.security.demo.entity.BtModule;
import com.security.demo.service.BtModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: zhsong
 * @time: 2021/9/6 14:58
 */
@RestController
@RequestMapping("/allModule")
public class BtModuleController {

    @Autowired
    BtModuleService btModuleService;

    @RequestMapping("/insert")
    public String insertBtModule(@RequestParam String name, @RequestParam String operationName) throws Exception {
        btModuleService.insertBtModule(name,operationName);
        return "insert";
    }
    //删除

    @RequestMapping("/delete")
    public String deleteBtModule(@RequestParam String name,@RequestParam String operationName) throws Exception {
        btModuleService.deleteBtModule(name,operationName);
        return "delete";
    }

    @RequestMapping("/select")
    public String selectBtModules(@RequestParam String name) throws Exception {
        List<String> list = btModuleService.selectBtModule(name);
        return list.toString();
    }
}
